using System;
using System.Collections.Generic;
using System.Text;
using System.Collections;
using System.Windows.Forms;
using System.Reflection;


namespace THSLib
{
    public abstract class THSUndoEngine
    {
        protected Stack undoStack;
        protected Stack redoStack;
        protected THSScreen _screen;

        public THSUndoEngine(THSScreen scr)
        {
            undoStack = new Stack();
            redoStack = new Stack();
            _screen = scr;
        }

        public THSScreen Screen
        {
            get { return _screen; }
            set
            {
                _screen = value;
            }
        }       

        public void AddUndoUnit(THSUndoUnit undoUnit)
        {
            undoStack.Push(undoUnit);
        }

        public THSUndoUnit CreateUndoUnit(String strUndoUnitName,String strUndoUnitPropertyName, String strUndoUnitStatus, object objUndoUnitObject)
        {
            return new THSUndoUnit(strUndoUnitName,strUndoUnitPropertyName, strUndoUnitStatus, objUndoUnitObject);
        }

        public void AddUndoUnit(String strUndoUnitName,String strUndoUnitPropertyName, String strUndoUnitStatus, object objUndoUnitObject)
        {
            THSUndoUnit undoUnit = CreateUndoUnit(strUndoUnitName,strUndoUnitPropertyName, strUndoUnitStatus, objUndoUnitObject);
            undoStack.Push(undoUnit);
        }

        public abstract void Undo();

        public abstract void Redo();

        protected abstract void SetControlValue(THSUndoUnit undoUnit);
       

        

    }

    
}
